<template>
    <div class="container">
        <!-- 设计列表 -->
        <designReviewList v-if="deviseShow" @goDevise="goDevise" @updatePhotos="updatePhotos" />
        <designupdate v-else :deviseList="deviseList" @goBack="goBack" @clearMeasurement="clearMeasurement" @uploadSuccess="goBack"/>
    
    </div>
</template>
    
<script setup>
import designReviewList from './components/designReviewList'
import designupdate from './components/designupdate'
import {listMeasurementgetInfo} from '@/api/costSum'

// 切换页面
let deviseShow = ref(true)
// 数据
const deviseList = ref(null)

const goDevise = (v) => {
    deviseList.value = v
    deviseShow.value = false
}

// 返回上一级
const goBack = () => {
    deviseShow.value = true
}
// 测量详情接口
const listMeasurementgetInfoFn = async (v) => {
    let params = {
        id: v
    }
    let { code, data } = await listMeasurementgetInfo(params)
    if (code == 200) {
        deviseList.value = data
        deviseShow.value = false
    }
}
// 上传设计 数据回显
const updatePhotos = (v) => {
    // listMeasurementgetInfoFn(v.id)
    deviseList.value = v
        deviseShow.value = false
}
// 清空数据
const clearMeasurement = ()=>{
    deviseList.value = null
}
</script>
    
<style scoped lang="scss"></style>
